# Create a library called "lib<name>" which includes the source files given in
# the array .
# The extension is already found.  Any number of sources could be listed here.

set(INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/BASE
${CMAKE_SOURCE_DIR}/PHYSICS
${CMAKE_SOURCE_DIR}/SIM
${GSLCBLAS_INCLUDE_DIRS}
${ROOT_INCLUDE_DIR}
)

include_directories( ${INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}
${ROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
  CpFunctions.cxx 
  CpPoint.cxx
  CpTrack.cxx
  CpParticle.cxx
  CpVGenerator.cxx
  CpVTransporter.cxx
  CpSimpleGenerator.cxx
  CpSimpleTransporter.cxx
  CpSimulator.cxx
)

String(REPLACE ".cxx" ".h" HDRS "${SRCS}")

AddLibrary(CPSim "${SRCS}" "${HDRS}")
target_link_libraries(CPSim CPBase gsl Rint Core Matrix MathCore Hist)
# Set(LIBS CPBase CPSim)
# AddExecutable(coldpig-sim-gsl CpGSLMain.cxx "${LIBS}")